//
//  HRDynamicBottomView.m
//  Hear
//
//  Created by mac on 2017/4/17.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HRDynamicBottomView.h"
@interface HRDynamicBottomView()
@property (nonatomic, strong)UIButton *chatButton;
@property (nonatomic, strong)UILabel *line;

@end
@implementation HRDynamicBottomView

- (void)setInfoModel:(HRUpdataUserInfoModel *)infoModel {
    if ([infoModel.LocalId isEqualToString:@"admin"]){
        [self.chatButton setTitle:@"联系hearer君" forState:0];
    }
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = CustomColor(90, 190, 230, 1);
        
        UIButton *followBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kFullWidth/2, 40)];
        [followBtn setTitle:@"关注" forState:UIControlStateNormal];
        [followBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        followBtn.titleLabel.font = [UIFont boldSystemFontOfSize:15];
        [followBtn addTarget:self action:@selector(followBtnClick) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:(self.followBtn = followBtn)];
        
        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(kFullWidth/2, 10, 1, 20)];
        line.backgroundColor = [UIColor whiteColor];
        [self addSubview:line];
        
        UIButton *chatButton = [[UIButton alloc] initWithFrame:CGRectMake(kFullWidth/2, 0, kFullWidth/2, 40)];
        [chatButton setTitle:@"私聊" forState:UIControlStateNormal];
        [chatButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        chatButton.titleLabel.font = [UIFont boldSystemFontOfSize:15];
        [chatButton addTarget:self action:@selector(chatButtonClick) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:(self.chatButton = chatButton)];
        
    }
    return self;
}

- (void)followBtnClick {
    if (self.followBlock) {
        self.followBlock();
    }
}

- (void)chatButtonClick{
    if (self.chatButtonBlock){
        self.chatButtonBlock();
    }
}

- (void)attentionButtonClick{
    
    if (self.attentionButtonBlock){
        self.attentionButtonBlock();
    }
}


@end
